﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Models;
using System.ComponentModel;

namespace BLL
{
    [DataObject]
    public class TarefasBLL
    {
        private TarefasDAL dal = new TarefasDAL();

        //decorando o método: colocar um atributo no método [DataObjectMethod]
        [DataObjectMethod(DataObjectMethodType.Select)]
        public List<Tarefas> Listar(int CodigoIteracao)
        {
            return dal.Listar(CodigoIteracao);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public List<Tarefas> ListarGeral()
        {
            return dal.ListarGeral();
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public Tarefas Ler(int codigoTarefa)
        {
            return dal.Ler(codigoTarefa);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public void Incluir(Tarefas instancia)
        {
            dal.Incluir(instancia);
        }

        [DataObjectMethod(DataObjectMethodType.Update)]
        public void Alterar(Tarefas instancia)
        {
            dal.Alterar(instancia);
        }

        [DataObjectMethod(DataObjectMethodType.Delete)]
        public void Excluir(int codigoTarefa)
        {
            dal.Excluir(codigoTarefa);
        }
    }
}
